﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Core.Entities;
using Core.Enums;

namespace Core.Writer
{
    internal class TriggerWriter : IDataWriter
    {
        public static readonly TriggerWriter Instance = new TriggerWriter();

        private TriggerWriter()
        {

        }

        public object this[string Name]
        {
            set { Throw(); }
        }
        public object this[int Index]
        {
            set
            {
                Throw();
            }
        }

        public RWTypes ObjectType
        {
            get
            {
                return RWTypes.Object;
            }
            set
            {
                Throw();
            }
        }

        public void Add(string Name, object Value)
        {
            Throw();
        }

        public IDataWriter CreateChildrenWriter(CreateChildrenWriterInfo Info)
        {
            Throw();

            return null;
        }

        public void Dispose()
        {
        }

        private void Throw()
        {
            throw new Exception("触发器中不能写入数据。");
        }

        public void Next()
        {
        }
    }
}